# -*- coding: utf-8 -*-

'''
author:Cooper
date:2012.5.7

在线订购API
taobao.vas.order.search 订单记录导出
taobao.vas.subsc.search 订购记录导出
taobao.vas.subscribe.get 订购关系查询
'''

from TopAPI.lib import *
import json

class order():
	api='taobao.vas.order.search'
	def __init__(self):
		self.method=self.api
		self.setParams()
	def setParams(self,session,format='json'):
		self.__dict__.update(locals())
	def getRes(self):
		d={k:v for k,v in self.__dict__.items() if k!='self' and v!=None}
		url=getURL(d)
		return getRes(url)
	def parseData(self):
		r=self.getRes()
		j=jons.loads(j.content,j.encoding)
		return j
	pass
class subsc():
	api='taobao.vas.subsc.search'
	def __init__(self):
		self.method=self.api
		self.setParams()
	def setParams(self,session,format='json'):
		self.__dict__.update(locals())
	def getRes(self):
		d={k:v for k,v in self.__dict__.items() if k!='self' and v!=None}
		url=getURL(d)
		return getRes(url)
	def parseData(self):
		r=self.getRes()
		j=jons.loads(j.content,j.encoding)
		return j
	pass
class subscribe():
	api='taobao.vas.subscribe.get'
	def __init__(self):
		self.method=self.api
		self.setParams()
	def setParams(self,session,format='json'):
		self.__dict__.update(locals())
	def getRes(self):
		d={k:v for k,v in self.__dict__.items() if k!='self' and v!=None}
		url=getURL(d)
		return getRes(url)
	def parseData(self):
		r=self.getRes()
		j=jons.loads(j.content,j.encoding)
		return j
	pass

def main():
	pass
if __name__=='__main__':
	main()
	pass
